//
//  Test.m
//  atXiaoGeBClient
//
//  Created by Linyu Niu on 11/04/2018.
//  Copyright © 2018 Linyu Niu. All rights reserved.
//

#import "Test.h"

@implementation Test
+(void)gaintoken:(NSInteger)type{
    [[CTMediator sharedInstance] getTokenWithTokentype:[NSNumber numberWithInteger:type].stringValue block:^(NSDictionary * result){
        NSString * token = [result objectForKey:@"token"];
        [[CTMediator sharedInstance] setToken:token];
        [self sendSMS:@"13916574941" type:1];
    }];
}

+(void)sendSMS:(NSString *)mobile type:(NSInteger)type{
    [[CTMediator sharedInstance] sendMessageWithType:[NSNumber numberWithInteger:type].stringValue mobile:mobile block:^(NSDictionary * result){
        [self registerWithMobile:mobile code:[result objectForKey:@"valiCode"] pwd:@"123"];
    }];
}
+(void)registerWithMobile:(NSString *)mobile code:(NSString *)code pwd:(NSString *)pwd{
    [[CTMediator sharedInstance] registerOrLogin:mobile code:code pwd:pwd block:^(NSDictionary * result){
        
    }];
}
@end
